import Vue from 'vue';
import {Main} from 'tsmodules/module';
import 'tscommon/ts/Vue.ext';
import container from 'tscomponents/pc/ContainerPlugin.vue';
import loading from 'tscomponents/pc/LoadingPlugin.vue';
import errorLabel from 'tscomponents/pc/ErrorLabelPlugin.vue';
import AMapPlugin from 'tscomponents/pc/AMapPlugin.vue';

import '../../common/less/pc.less';
import '../../components/pc/directive';


Vue.component('async-load',loading);
Vue.component('container',container);
Vue.component('form-error',errorLabel);
Vue.component('amap',AMapPlugin);

const entry = {
  template:"<container :width='width' :height='height' :scroll='false'><async-load :module='comp' :space='vuexspace' ></async-load></container>",
  data(){
    return {
      width:window.innerWidth,
      height:window.innerHeight,
      comp:Main,
      vuexspace:['main']
    }
  },
  mounted(){
    window.onresize = ()=>{
      (<any>this).width = window.innerWidth;
      (<any>this).height = window.innerHeight;
    }
  }
}

new Vue({
  el: '#app',
  render:h=>h(entry)
})